using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using TVT.Common.Exceptions;
using System.Diagnostics;
using TVT.BizLayer.Helpers;
using System.Text.RegularExpressions;
using TVT.Common.Helpers;

namespace TVT.UI
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
        }

        protected void Application_End(object sender, EventArgs e)
        {
            
        }

        protected void Application_Error(Object sender, EventArgs e)
        {
            ExceptionLogger.HandleException(Server.GetLastError().GetBaseException());
            bool exceptionShielding = false;
            try
            {
                exceptionShielding = bool.Parse(ConfigurationManager.AppSettings[WellKnownKeys.ExceptionShieldingKey].ToString());
                if (exceptionShielding)
                {
                    Response.Redirect("~/error.aspx");
                }
            }
            catch (Exception)
            {
                
            }
                        
        }        
    }
}
